/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SPARQL.PP;

import SPARQL.PropertyPath;
import java.util.Objects;

/**
 *
 * @author riccardo
 */
public class Concatenation extends PropertyPath{
    private PropertyPath p1;
    private PropertyPath p2;

    public Concatenation(PropertyPath p1, PropertyPath p2) {
        this.p1 = p1;
        this.p2 = p2;
    }

    
    
    public PropertyPath getP1() {
        return p1;
    }

    public PropertyPath getP2() {
        return p2;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 41 * hash + Objects.hashCode(this.p1);
        hash = 41 * hash + Objects.hashCode(this.p2);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Concatenation other = (Concatenation) obj;
        if (!Objects.equals(this.p1, other.p1)) {
            return false;
        }
        if (!Objects.equals(this.p2, other.p2)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return p1 + "/" + p2;
    }

    @Override
    public Object clone(){
        return new Concatenation((PropertyPath) p1.clone(), (PropertyPath) p2.clone());
    }
    
    
}
